<#import "base.ftl" as base/>
<#import "spring.ftl" as spring/>

<@base.baseTemplate title="computerscanresult">
	<div class="unit" style="width: 560px;">
		<div class="line"><label><@spring.message "computerName"/>:</label><span class="formvalue">${scan.computerName!}</span></div>
		<div class="line"><label><@spring.message "cpuType"/>:</label><span class="formvalue">${scan.cpu!}</span></div>
		<div class="line"><label><@spring.message "computersid"/>:</label><span class="formvalue">${scan.sid!}</span></div>
		<div class="line"><label><@spring.message "computerram"/>:</label><span class="formvalue">${((scan.ram!0)?number / 1048576)?string("0.##")} GB</span></div>
		<div class="line"><label><@spring.message "type"/>:</label><span class="formvalue"><@spring.message "pctype.${scan.computerType!}"/></span></div>
		<div class="line"><label><@spring.message "operatingSystem"/>:</label><span class="formvalue">${scan.operatingSystem!}</span></div>
		<div class="line"><label><@spring.message "ipAddress"/>:</label><span class="formvalue">${scan.scanIpAddress!}</span></div>
		
		<div class="line" style="padding-top: 20px;"><label><@spring.message "networkAdapterList"/></label></div>
		
		<div class="line accordion">
			<#list scan.networkAdapterList as networkAdapter>
				<h3><a href="#"><@spring.message "networkAdapterList"/>: ${networkAdapter.name!}</a></h3>
				<div class="line">
					<div class="line"><label><@spring.message "ipAddress"/>:</label><span class="formvalue">${networkAdapter.ipAddress!}</span></div>
					<div class="line"><label><@spring.message "computerMacAddress"/>:</label><span class="formvalue">${networkAdapter.macAddress!}</span></div>
					<div class="line"><label><@spring.message "computerDHCP"/>:</label><span class="formvalue">${networkAdapter.dhcpServer!}</span></div>
					<div class="line"><label><@spring.message "computerSubnet"/>:</label><span class="formvalue">${networkAdapter.subnet!}</span></div>
					<div class="line"><label><@spring.message "computerDefaultGateway"/>:</label><span class="formvalue">${networkAdapter.defaultGateway!}</span></div>
				</div>	
			</#list>
		</div>
		
		<div class="line" style="padding-top: 20px;"><label><@spring.message "softwareList"/></label></div>
		<table class="ui-widget scanSubTable" style="border: solid 1px;">
			<thead class="ui-widget-header">
				<tr>
			  		<th width="80%"><@spring.message "name"/></th>
			  		<th width="20%"><@spring.message "version"/></th>
			  	</tr>
			</thead>
			<tbody class="ui-widget-content">
				<#list scan.softwareList as software>
					<tr>
				  		<td>${software.name}</td>
				  		<td>${software.version}</td>
				  	</tr>	
				</#list>
			</tbody>
		</table>
		
		<div class="line" style="padding-top: 20px;"><label><@spring.message "printerList"/></label></div>
		<table class="ui-widget scanSubTable" style="border: solid 1px;">
			<thead class="ui-widget-header">
				<tr>
			  		<th width="50%"><@spring.message "name"/></th>
			  		<th width="30%"><@spring.message "driver"/></th>
			  		<th width="20%"><@spring.message "driverVersion"/></th>
			  	</tr>
			</thead>
			<tbody class="ui-widget-content">
				<#list scan.printerList as printer>
					<tr>
				  		<td>${printer.name}</td>
				  		<td>${printer.driver!}</td>
				  		<td>${printer.driverVersion!}</td>
				  	</tr>	
				</#list>
			</tbody>
		</table>
	</div>
	<div class="unit" style="width: 200px;">
		<b><@spring.message "computerHistory"/></b>
		<table class="ui-widget" style="border: solid 1px;">
			<thead class="ui-widget-header">
				<tr>
			  		<th><@spring.message "scan"/></th>
			  	</tr>
			</thead>
			<tbody class="ui-widget-content">
			  	<#list scan_list as scanresult>
			  		<tr>
					  	<td>
					  		<a href="${rc.getContextPath()}/scan/${scanresult.id}">
					  			<#if scanresult.id! == scan.id!>
					  				<b>${scanresult.timeStamp}</b>
					  			<#else>
					  				${scanresult.timeStamp}
				  				</#if>
				  			</a>
				  		</td>
			  		</tr>
				</#list>
			</tbody>
		</table>
	</div>
</@base.baseTemplate>